Skip to content

Implementing missing macros to openssl compatibility layer #10520

Open
Roy-Carter wants to merge 1 commit into
wolfSSL:masterfrom
Roy-Carter:feature/extending_comp_layer
Open

Implementing missing macros to openssl compatibility layer #10520
Roy-Carter wants to merge 1 commit into
wolfSSL:masterfrom
Roy-Carter:feature/extending_comp_layer

Conversation

@Roy-Carter
Copy link
Copy Markdown
Contributor

Description

Implementing as part of migration to wolfssl
SSL_set_ciphersuites
X509_add1_ext_i2d
sk_GENERAL_NAME_new_null
EC_KEY_oct2key

Testing

unitests to each functionality added

Checklist

  • [ *] added tests
  • [ *] updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@wolfSSL-Bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@Roy-Carter
Copy link
Copy Markdown
Contributor Author

@julek-wolfssl second part of the functions i've implemented , split the PR's for clarity of checks .

@Roy-Carter Roy-Carter force-pushed the feature/extending_comp_layer branch from 54ef2e4 to 413e8ac Compare May 24, 2026 11:04
@Roy-Carter
Copy link
Copy Markdown
Contributor Author

@dgarske errors seemed related to master diff. both tests worked for me locally , I rebased , can we re-run workflow?

@Roy-Carter Roy-Carter force-pushed the feature/extending_comp_layer branch from 413e8ac to 62138a2 Compare May 29, 2026 12:42
@Roy-Carter
Copy link
Copy Markdown
Contributor Author

@julek-wolfssl @dgarske I've rebased to master , seems related to new changes added .

@dgarske
Copy link
Copy Markdown
Member

dgarske commented May 29, 2026

Jenkins okay to test

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the OpenSSL compatibility layer with aliases and implementations for several missing APIs used during migration to wolfSSL.

Changes:

  • Adds compatibility mappings for SSL_set_ciphersuites, X509_add1_ext_i2d, sk_GENERAL_NAME_new_null, and EC_KEY_oct2key.
  • Implements wolfSSL_X509_add1_ext_i2d and wolfSSL_EC_KEY_oct2key.
  • Adds unit tests covering the new compatibility APIs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
wolfssl/ssl.h Declares the new X509 extension helper.
wolfssl/openssl/ssl.h Adds OpenSSL compatibility macros for SSL, X509, and GENERAL_NAME APIs.
wolfssl/openssl/ec.h Declares and maps EC_KEY_oct2key.
src/x509.c Implements wolfSSL_X509_add1_ext_i2d.
src/pk_ec.c Implements wolfSSL_EC_KEY_oct2key.
tests/api.c Adds API tests for the new compatibility additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/x509.c
Comment on lines +3532 to +3534
if (flags != 0) {
WOLFSSL_MSG("X509V3_ADD_* flags not supported; using default behavior");
}
Comment thread src/x509.c
Comment on lines +3536 to +3541
ext = wolfSSL_X509V3_EXT_i2d(nid, crit, value);
if (ext == NULL) {
return WOLFSSL_FAILURE;
}

ret = wolfSSL_X509_add_ext(x, ext, -1);
Comment thread tests/api.c
Comment on lines +21310 to +21311
ExpectIntEQ(wolfSSL_X509_add1_ext_i2d(x509, NID_subject_alt_name, gns, 0,
0), WOLFSSL_SUCCESS);
Comment thread tests/api.c
Comment on lines +20581 to +20583
ExpectNotNull(gn = GENERAL_NAME_new());
ExpectIntEQ(sk_GENERAL_NAME_push(sk, gn), 1);
ExpectIntEQ(sk_GENERAL_NAME_num(sk), 1);
Copy link
Copy Markdown
Member

@julek-wolfssl julek-wolfssl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Roy-Carter please address copilot review. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants